package cn.madis.ymcc.fallback;

import cn.madis.ymcc.UserFeignClient;
import cn.madis.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFeignClientFallbackFactory implements FallbackFactory<UserFeignClient> {
    @Override
    public UserFeignClient create(Throwable throwable) {
        return new UserFeignClient() {
            @Override
            public JSONResult list() {
                throwable.printStackTrace();
                return JSONResult.error("list降级gggg");
            }
        };
    }
}
